#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/7/27 17:11
# @Author  : ldh

from basic.device.Android import Android

class AGXDigitalCardPage(Android):
    digital_name="cn.cloudbae.loveguangxi:id/digital_name" #卡片名
    textView="cn.cloudbae.loveguangxi:id/textView18" #卡片详情页


    @classmethod
    def openDigitalPage(cls):
        cls.poco(text="数字证照").click()

    #判断数字证照列表卡片是否为空，若非空打印出证照名称及数量
    @classmethod
    def getCards(cls):
        cardName=[]
        cardNum=len(cls.poco(cls.digital_name))
        for i in range(0,cardNum):
            cardName.append(cls.poco(cls.digital_name)[i].get_text())
        print(cardName)
        if cardNum > 0:
            print("数字证照列表卡片数：%d"%(cardNum))
            return True

    #打开证照详情
    @classmethod
    def openDigitalCard(cls):
        cls.poco(cls.digital_name)[0].click()
        print("查看证照详情")

